{% extends base_template %}
{% load helpers %}
{% load form_helpers %}

{% block content %}
    {% if perms.extras.add_note %}
        <form action="{% url 'extras:note_add' %}?return_url={{ request.path }}?tab=notes" method="post" enctype="multipart/form-data">
            <div class="row justify-content-center">
                <div class="col-md-10 col-lg-8">
                    <h3 class="mb-16">Add a new note</h3>
                    <div class="card">
                        <div class="card-header">
                            <strong>Note</strong>
                        </div>
                        <div class="card-body">
                            {% csrf_token %}
                            {% render_form form %}
                        </div>
                    </div>
                </div>
            </div>
            <div class="row justify-content-center">
                <div class="col-md-10 col-lg-8 gap-8 hstack justify-content-end mb-16">
                    <button id="createNote" type="submit" class="btn btn-primary">
                        <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
                        -->Create
                    </button>
                    <a href="{{ object.get_absolute_url }}" class="btn btn-secondary">
                        <span aria-hidden="true" class="mdi mdi-close me-4"></span><!--
                        -->Cancel
                    </a>
                </div>
            </div>
        </form>
    {% endif %}

    <div class="card">
        {% include 'responsive_table.html' %}
    </div>
    {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
{% endblock %}
